/* 
* This module is part of the Entertainment Network system 
* Copyright (c) SCC Soft Computer, Inc. 2018 
* All Rights Reserved 
* 
* This document contains unpublished, confidential and proprietary 
* information of SCC Soft Computer, Inc. No disclosure or use of 
* any portion of the contents of these materials may be made without the 
* express written consent of Soft Computer Consultants, Inc. 
* 
*/ 

package isd.dp.ua.EntertainmentNetworkServer.Models;
// Generated Mar 14, 2018 11:11:06 AM by Hibernate Tools 3.6.0.Final

import java.math.BigDecimal;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.*;
import javax.xml.bind.annotation.XmlAccessType;
import javax.xml.bind.annotation.XmlAccessorType;
import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlTransient;
import javax.xml.bind.annotation.XmlType;

import isd.dp.ua.EntertainmentNetworkServer.Common.BaseModel;

/**
 * Floor generated by hbm2java
 */
@SuppressWarnings("serial")
@XmlAccessorType(XmlAccessType.FIELD)
@XmlType
@Entity
@Table(name = "FLOOR", schema = "PBAB")
public class Floor extends BaseModel implements java.io.Serializable
{
	public Floor()
	{
	}

	public Floor(BigDecimal flrId, Hall hall)
	{
		this.flrId = flrId;
		this.hall = hall;
	}

	public Floor(BigDecimal flrId, Hall hall, String flrName, Set<Seat> seats) 
	{
		this.flrId = flrId;
		this.hall = hall;
		this.flrName = flrName;
		this.seats = seats;
	}

	@Id
	@GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "FLR_SEQ")
    @SequenceGenerator(name = "FLR_SEQ", sequenceName = "FLR_SEQ")
	@Column(name = "FLR_ID", unique = true, nullable = false, precision = 22, scale = 0)
	public BigDecimal getFlrId() 
	{
		return this.flrId;
	}

	public void setFlrId(BigDecimal flrId) 
	{
		this.flrId = flrId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "FLR_HAL_ID", nullable = false)
	public Hall getHall() 
	{
		return this.hall;
	}

	public void setHall(Hall hall) 
	{
		this.hall = hall;
	}
	
	@Transient
	@XmlElement
	public BigDecimal getHallId()
	{
		return this.getHall() == null ? new BigDecimal("-1") : this.getHall().getHalId();
	}

	@Column(name = "FLR_NAME", length = 100)
	public String getFlrName() 
	{
		return this.flrName;
	}

	public void setFlrName(String flrName) 
	{
		this.flrName = flrName;
	}

	@OneToMany(fetch = FetchType.LAZY, mappedBy = "floor")
	public Set<Seat> getSeats() 
	{
		return this.seats;
	}

	public void setSeats(Set<Seat> seats) 
	{
		this.seats = seats;
	}
	
	@Override
	public String toString()
	{
		return "Floor [flrId=" + this.getFlrId() + ", flrName=" + this.getFlrName() + "]";
	}
	
	private BigDecimal flrId;
	@XmlTransient
	private Hall hall;
	private String flrName;
	@XmlTransient
	private Set<Seat> seats = new HashSet<Seat>(0);
}
